package wechat.handler.work.menu;

import java.io.IOException;

import org.apache.http.client.ClientProtocolException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson.JSONObject;

import wechat.handler.util.Configure;
import wechat.handler.util.http.HttpClientUtil;

public class MenuScancodeWaitmsgHandler {
	private static Configure INS = Configure.getInstans();
	
	private Logger log = LoggerFactory.getLogger(MenuScancodeWaitmsgHandler.class);
	
	public MenuScancodeWaitmsgHandler(){
		
	}
	
	public void buildBindCode(String openid,String type,String payCode){
		String redirectURL = INS.getValue("Bind");
		
		redirectURL = redirectURL.replace("OPENID", openid).replace("PAYCODE", payCode);
		log.info("MenuScancodeWaitmsgHandler--buildRegister redirectURL=" + redirectURL);
		
		try {
			HttpClientUtil.get(redirectURL);
		} catch (ClientProtocolException e) {
			log.error("MenuScancodeWaitmsgHandler--buildRegister: send fail",e);
			e.printStackTrace();
		} catch (IOException e) {
			log.error("MenuScancodeWaitmsgHandler--buildRegister: send fail",e);
			e.printStackTrace();
		}
	}
}
